package com.chag.app.biz.dao.gen;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface MemberLotteryMapper {
    int countByExample(MemberLotteryCriteria example);

    int deleteByExample(MemberLotteryCriteria example);

    @Delete({
        "delete from MEMBER_LOTTERY",
        "where MEMBER_LOTTERY_ID = #{memberLotteryId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer memberLotteryId);

    @Insert({
        "insert into MEMBER_LOTTERY (MEMBER_LOTTERY_ID, MEMBER_ID, ",
        "LOTTERY_ID, TIME, ",
        "AWARD_ID, AWARD)",
        "values (#{memberLotteryId,jdbcType=INTEGER}, #{memberId,jdbcType=INTEGER}, ",
        "#{lotteryId,jdbcType=INTEGER}, #{time,jdbcType=TIMESTAMP}, ",
        "#{awardId,jdbcType=INTEGER}, #{award,jdbcType=VARCHAR})"
    })
    int insert(MemberLottery record);

    int insertSelective(MemberLottery record);

    List<MemberLottery> selectByExample(MemberLotteryCriteria example);

    @Select({
        "select",
        "MEMBER_LOTTERY_ID, MEMBER_ID, LOTTERY_ID, TIME, AWARD_ID, AWARD",
        "from MEMBER_LOTTERY",
        "where MEMBER_LOTTERY_ID = #{memberLotteryId,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    MemberLottery selectByPrimaryKey(Integer memberLotteryId);

    int updateByExampleSelective(@Param("record") MemberLottery record, @Param("example") MemberLotteryCriteria example);

    int updateByExample(@Param("record") MemberLottery record, @Param("example") MemberLotteryCriteria example);

    int updateByPrimaryKeySelective(MemberLottery record);

    @Update({
        "update MEMBER_LOTTERY",
        "set MEMBER_ID = #{memberId,jdbcType=INTEGER},",
          "LOTTERY_ID = #{lotteryId,jdbcType=INTEGER},",
          "TIME = #{time,jdbcType=TIMESTAMP},",
          "AWARD_ID = #{awardId,jdbcType=INTEGER},",
          "AWARD = #{award,jdbcType=VARCHAR}",
        "where MEMBER_LOTTERY_ID = #{memberLotteryId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(MemberLottery record);
}